
/**
 * Created by xiongshilin on 2017/4/14.
 */
ADF.domControl.BootstrapColumn = function(parent) {
    ADF.domControl.BootstrapColumn.superclass.constructor.call(this, parent);
};

COM.util.defineClass(ADF.domControl.BootstrapColumn, ADF.domControl.Composite, {
    getLabel: function(){
        return "Row";
    },
    appendDomChild: function(child) {
        this.getDomElement().children[0].appendChild(child);
    },
    removeDomChild: function(child) {
        this.getDomElement().children[0].removeChild(child);
    },
    _getDomElement: function(model) {
        var columnWrap = this.createColumnWrap(model);
        var column = this.createColumn(model);
        columnWrap.append(column);
        this.domElement = columnWrap[0];
        return this.domElement;
    },
    createColumnWrap: function(model) {
        var bounds = model.getBounds();
        var rowWrap = COM.util.HTMLUtil.createELement('<div class="bootstrapWrap columnWrap adf_wrapper '+model.getLayoutData()+'"></div>');
        var css = {"display":"block",
            "position":"relative"
        };
        css.minHeight = bounds.height > 0 ? bounds.height:30;
        rowWrap.css(css);
        return rowWrap;
    },
    createColumn: function(model) {
        var column = COM.util.HTMLUtil.createELement('<div class="column"></div>');
        var css = {"position":"relative",
            "overflow":"visible",
            "background-color":"rgba(89,89,89,1)"};
        //css.minHeight = 60;
        column.css(css);
        return column;
    }
});